var a = getApp();

Page({
    data: {
        images: [],
        isshow: !1,
        is_label: !1,
        panelIndex: 0,
        kFootshow: !0
    },
    onLoad: function(a) {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
        var e = wx.getStorageSync("yz_basic_info").lang.goods ? wx.getStorageSync("yz_basic_info").lang.goods.price : "现价", o = wx.getStorageSync("yz_basic_info").lang.goods ? wx.getStorageSync("yz_basic_info").lang.goods.market_price : "原价";
        this.setData({
            price: e,
            market_price: o
        }), a.id && this.setData({
            id: a.id
        }), this.getData();
    },
    tabrshowbtn: function(a) {
        a.detail && this.setData({
            kFootshow: !1
        });
    },
    myshow: function(a) {
        console.log(a), this.setData({
            isshow: a.detail
        });
    },
    callPhone: function(a) {
        var t = a.currentTarget.dataset.item.mobile;
        console.log(a), wx.makePhoneCall({
            phoneNumber: t
        });
    },
    copy: function(a) {
        console.log(a);
        var t = a.currentTarget.dataset.item.yz_member.wechat, e = a.currentTarget.dataset.item.nickname;
        wx.setClipboardData({
            data: t,
            success: function(a) {
                wx.getClipboardData({
                    success: function(a) {
                        wx.showToast({
                            icon: "none",
                            title: "已成功将" + e + "的微信号添加到剪贴板，通过微信添加朋友可加客户好友!",
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    showImga: function() {
        console.log(this.data.resultData.report.check_img_src);
        var a = this.data.resultData.report.check_img_src;
        wx.previewImage({
            urls: [ a ]
        });
    },
    baclOut: function() {
        wx.redirectTo({
            url: "/packageE/others/skin/skin"
        });
    },
    tapMore: function(a) {
        var t = a.currentTarget.dataset.item.id;
        wx.navigateTo({
            url: "/packageA/member/article/articleContent/articleContent?article_id=" + t
        });
    },
    gotoUrl: function(a) {
        var t = a.currentTarget.dataset.item;
        console.log(t), 1 == this.data.resultData.business_card && wx.navigateTo({
            url: "/packageB/member/business_card/BusinessCard/BusinessCard?card_id=" + t.business_card.id + "&mark_id=" + t.business_card.id + "&mark=card"
        });
    },
    tapAll: function() {
        wx.navigateTo({
            url: "/packageE/others/all_result/all_result?id=" + this.data.id + "&num=" + this.data.resultData.report.id
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            path: "/packageE/others/share/share?id=" + this.data.id
        };
    },
    tapGood: function(a) {
        var t = a.currentTarget.dataset.kid;
        wx.navigateTo({
            url: "/packageA/detail_v2/detail_v2?id=" + t
        });
    },
    chooseTabData: function(a) {
        console.log(a);
        var t = a.detail.index, e = this.data.label[t].id;
        this.getTab(e);
    },
    goShare: function() {
        this.setData({
            isshow: !0
        });
    },
    getTab: function(t) {
        wx.showLoading({
            title: "加载中"
        });
        var e = this, o = a.getNetAddresss("plugin.skin-check.api.skin-check.label-goods");
        a._getNetWork({
            url: o,
            data: {
                label_id: t
            },
            success: function(a) {
                wx.hideLoading({
                    complete: function(a) {}
                });
                var t = a.data;
                console.log(t), 1 == t.result ? e.setData({
                    goodsLis: t.data
                }) : wx.showToast({
                    icon: "none",
                    title: t.msg,
                    duration: 1500
                });
            },
            fail: function(a) {
                console.log(a), wx.hideLoading({
                    complete: function(a) {}
                });
            }
        });
    },
    getData: function() {
        wx.showLoading({
            title: "加载中"
        });
        var t = this, e = a.getNetAddresss("plugin.skin-check.api.skin-check.check-report");
        a._getNetWork({
            url: e,
            data: {
                report_id: t.data.id
            },
            success: function(a) {
                wx.hideLoading({
                    complete: function(a) {}
                });
                var e = a.data;
                console.log(e), 1 == e.result ? (t.setData({
                    resultData: e.data,
                    images: t.data.images.push(e.data.report.check_img_src),
                    goodsLis: e.data.goods
                }), e.data.label && t.setData({
                    is_label: !0,
                    label: e.data.label
                })) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(a) {
                console.log(a), wx.hideLoading({
                    complete: function(a) {}
                });
            }
        });
    }
});